#include "StdAfx.h"
#include "Chorus.h"


CChorus::CChorus(void)
{
	m_wrloc = 0;
	m_rdloc = 0;
	m_queue.resize(200000);
	m_wet = 0.5;
	m_dry = 0.5;
}


CChorus::~CChorus(void)
{
}

void CChorus::Process(double *frameIn, double *frameOut, double time)
{
	const int QUEUESIZE = 200000;

    // Loop over the channels
    for(int c=0;  c<2;  c++)
    {
        m_queue[m_wrloc + c] = frameIn[c];
		frameOut[c] = m_dry * frameIn[c] + m_wet * m_queue[m_rdloc + c];
    }

    m_wrloc = (m_wrloc + 2) % QUEUESIZE;
    m_rdloc = (m_rdloc + 2) % QUEUESIZE;
}